package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.FileVersion;
import com.ruoyi.system.mapper.FileVersionMapper;
import com.ruoyi.system.service.FileVersionService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

import java.util.List;

@Service
@Slf4j
@RequiredArgsConstructor
public class FileVersionServiceImpl implements FileVersionService {

    private final FileVersionMapper fileVersionMapper;

    @Override
    public List<FileVersion> selectFileVersions(FileVersion fileVersion) {
        Assert.isTrue(!ObjectUtils.isEmpty(fileVersion.getFileId()), "fileId不能为空");
        List<FileVersion> fileVersions = fileVersionMapper.selectFileVersions(fileVersion);
        return fileVersions;
    }
}
